home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_D1CCCFF1D24C49DAB1A22D6676879569
< prev
next >
Wrap
Text File
|
2005-03-23
|
982b
|
48 lines
//simple shader to clip any pixels with a Z coordinate below the water plane
//does not apply lights
//applies vertex diffuse colors and texture sampling
//must be used with clipZ2.psh
//Luke Lenhart
//(C)2004-2005 Digipen Institute of Technology
//world,view,projection transform
float4x4 matWorldViewProj;
float4x4 matWorld;
//shader input
struct VS_INPUT
{
float4 Pos : POSITION;
float2 Tex0 : TEXCOORD0;
float4 Clr : COLOR0;
};
//shader output
struct VS_OUTPUT
{
float4 Pos0 : POSITION;
float PosZ : TEXCOORD1;
float2 Tex0 : TEXCOORD0;
float4 Clr : COLOR0;
};
//shader code
VS_OUTPUT VShader(VS_INPUT In)
{
VS_OUTPUT Out;
//copy tex coord
Out.Tex0=In.Tex0;
//calc transformed position
Out.Pos0=mul(matWorldViewProj,In.Pos);
float4 wPos=mul(matWorld,In.Pos);
Out.PosZ=wPos.z;
//copy color
Out.Clr=In.Clr;
//spit out the results
return Out;
}